<template>
	<view :style="viewColor">
		<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
			bgcolor="#FFF"></skeleton>
		<view class="product-con skeleton"  :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
			
			<view class="navbar" :style="{ height: navH + 'rpx', opacity: opacity }">
				<view class="navbar-title" :style="'height:' + navH + 'rpx;'">
					<view class="display-flex display-flex-align-center" :style="'margin-top:'+(sysHeight+20)+ 'rpx;'">{{navTitle}}</view>
				</view>
			</view>
			<!-- #ifndef MP-ALIPAY -->
			<view class="head-wrapper" id="home" :style="{ top: homeTop + 'rpx' }">
				<view class="head-menu-new" :style="{color: (opacity > 0.7 ?'#000' :'#fff'),background:  (opacity > 0.7 ?'#fff' :'rgba(0, 0, 0, .25)') }">
					<view class='iconfont icon-ic_left' @click="returns"></view>
					<view class="iconfont icon-ic_menu" @click="showNav"></view>
				</view>
			</view>
			
			<!-- 导航小图标 -->
			<view class="dialog_nav" v-show="currentPage" :style="{ top: navH+ scrollTop *2 + 'rpx' }">
				<view class="dialog_nav_item" :class="item.after" v-for="(item,index) in selectNavList" :key="index"
					@click="linkPage(item.url)">
					<text class="iconfont" :class="item.icon"></text>
					<text class="pl-20">{{item.name}}</text>
				</view>
			</view>	
			<!-- #endif -->
			
			
			<view class="">
				<view class="header-box-new"   :style="{visibility: navTitleShow?'':'hidden', top: (navH-10) + 'rpx'}">
					<view class="header-tab-box">
						<view class="header-tab-item " @click="tapNav(indexv)" v-for="(nav ,indexv) in navList" :key="indexv">
							<text>{{nav}}</text>
							<view v-if="indexv == navActive" class="tab-barline"></view>
						</view>
					</view>
					
				</view>
			</view>
			<view v-if="storeInfo">
				<view>
					<view class="artbox">
						<!-- #ifdef MP || APP-PLUS -->
						<!-- <view class="" :style="'width:100%;' + 'height:'+sysHeight + 'px'"></view> -->
						<!-- #endif -->
						<productConSwiper :imgUrls="storeInfo.slider_image" :videoCoverImg="videoCoverImg" :videoline="storeInfo.video_link" class="skeleton-rect" ></productConSwiper>
			
						<view class="swiper-bg pos-rel" style="top:0">
							<view class="detail-count">
								<view class='wrapper'>
									<view class="pad30">

										<view  class='share acea-row row-between row-bottom'>
											<view class='money p-color skeleton-rect' style="min-width: 70rpx;">
												<priceFormat :price="storeInfo.price"  :showRen="true" weight intSize="48" floatSize="32" labelSize="32"></priceFormat>
												<view v-if="svipData && svipData.show_svip_price && svipData.show_svip" style="display: inline-block;">
													<text class="vip-money regular">¥{{storeInfo.svip_price || 0}}</text>
													<image class="vip-image" :src="`${domain}/static/images/svip.png`"></image>
												</view>
											</view>
											<view class="fenxiang_btn">
												<view @click="setCollect">
													<text class="iconfont" :class="storeInfo.isRelation ? 'icon-ic_star1' : 'icon-ic_star'"></text><br/>收藏
												</view>
												<view @click="shareProduct"><text class="iconfont icon-a-ic_fenxiang1"></text><br/>分享</view>
											</view>
										</view>
										<view  class='introduce skeleton-rect'>
										{{storeInfo.store_name || ''}}
										<text class="text-12 color-67 ft-w500">{{storeInfo.store_info?(storeInfo.store_info):''}}</text>
										</view>

									</view>
								</view>
							</view>
							<view class="pad20 " style="padding-bottom: 10px;">
								<view class='coupon acea-row row-between-wrapper skeleton-rect bg-f boder-24 mt20' @click='couponTap' v-if="coupon.list.length > 0">
									<view class='hide line1 acea-row'>
										优惠券：
										<view class='activity' v-for="(item,index) in coupon.list" :key="index">满{{item.use_min_price}}减{{item.coupon_price}}</view>
									</view>
									<view class='iconfont icon-ic_right'></view>
								</view>
							</view>
						</view>	
					    <view v-if="dateList.length">
					    	<view class="packge-tickets">
					    		<view class="lab-title skeleton-rect">
					    			选择游玩日期
					    		</view>
					            <view class="riqi" >
					            	<view class="riqo-title mb-10 skeleton-rect">
					            		<text class="iconfont icon-rili2 text-16 mr-5"></text>
					    				<text class="text-14 text-black ft-w700">选择日期</text>
					            	</view>
					    			<view class="mb-10 skeleton-rect">
					    				<calendarSwiper  @handlerCalendar="handlerCalendar"
										 @handlerAllCalendar="handlerAllCalendar"
										 :dptDate="dptDate"
										 :saleDate="preSaleDate"
										 :dateList="dateList"
										 :tempDateObj="tempDateSwiper"
										 class="skeleton-rect"
										 >
										 </calendarSwiper>
					    			</view>
									<view v-if="dateList.length" class="display-flex display-flex-align-center text-12 color-102 skeleton-rect">
										<text class="iconfont icon-ic_tip  mr-2"></text>
										<text >以上价格为1位成人价格</text>
									</view>
	
					            </view>
					    		
					    	</view>
					    </view>
					    
						<!-- 详情介绍 -->
						<view v-if="description&&description.content"  class="article" style="background-color: #f5f5f5;position: relative;">
							<view class='product-intro ml-10 mr-10' >
								<view style="z-index:1" id="navTabFlag">
									<view class="route-tab-box">
										<view class="header-tab-item " @click="tapNav(indexv)" v-for="(nav ,indexv) in navList" :key="indexv">
											<text>{{nav}}</text>
											<view v-if="indexv == navActive" class="tab-barline"></view>
										</view>
									</view>
								</view>
										
								<view class="pad20" id="past0">
									<view v-if="storeInfo.traits && storeInfo.traits.length"  class="">
										<view class='title'>产品特色</view>
										<view class="de-block">
											<view class="ts-block-con display-flex" v-for="(trait,indext) in storeInfo.traits" :key="indext">
												<view class="ts-block-img-con">
													<image :src="'../../../static/images/tj'+(indext+1)+'.png'" style="width: 100%;height: 100%;"></image>
												</view>
												<view class="mt-5 flex-1">
													<text class="font-bold color-51 text-12">{{trait.key}}</text>
													<text class="color-51 text-12">{{trait.val}}</text>
												</view>
											</view>
											
										</view>
									
									</view>
									<view  v-if="description" class="">
										<view class='title'>详情介绍</view>
										<view class='conter'>
											<!-- #ifndef APP-PLUS -->
											<jyf-parser v-if="description.type == 0" @ready="parserLoad" :domain='domain' :html="description.content.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
											<!-- #endif -->
											<!-- #ifdef APP-PLUS -->
											<view v-if="description.type == 0" class="description" v-html="description.content.replace(/<br\/>/ig, '')"></view>
											<!-- #endif -->
											<view v-else class="product_content">
												<view v-if="description.content && description.content.title" class="title">{{description.content.title}}</view>
												<view v-if="description.content && description.content.image" class="pictures">
													<image v-for="(item,index) in description.content.image" :key="index" :src="item"></image>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
							
						</view>
						<!-- 详情介绍 -->
						
						<!-- 行程介绍 -->
						<view v-if="routeDays&&routeDays.length" class='article product-intro ml-10 mr-10 mt-10' id="past1">
							<view class="pad20">
								<view  class="">
									<view class='title'>{{storeInfo.day_time}}日行程</view>
									<view class="route-detail-box" v-for="(days,indexDay) in routeDays" :key="indexDay">
										<view class="route-detail-day">
											<text class="text-14 text-black mr-4 ft-w700">D{{indexDay+1}}</text>
											<text class="color-dde  mr-4 ">|</text>
											<text class="text-14 text-black ft-w700">{{days.title}}</text>
										</view>
										<view  v-if="days.trip_desc && days.trip_desc !=null">
											<text class="text-12 color_3e mb-15 line-heiht16 day-centent mt-10">
												{{days.trip_desc?days.trip_desc:''}}
											</text>
										</view>
										
										<view class="route-detail-content mt-10" v-if="days.show">
											<view class="route-detail-day-content" v-for="(day,indexd) in days.productRouteDetail" :index="indexd">
												<view class="route-detail-day-title mb-10">
													<view class="route-detail-img-block">
														<view class="route-detail-img">
															<image :src="'../../../static/images/xc_type'+day.type+'.png'"></image>
														</view>
													</view>
													<view class="display-flex">
														<text v-if="day.happen_time&&day.happen_time!=null &&day.happen_time!='0:00'" class="text-14 text-black ft-w700">
															{{day.happen_time}}
															<text class="text-14 text-black ft-w700 mr-2 ml-2"> · </text>
														</text>
														
														<text class="text-14 text-black ft-w700">
														{{day.title && day.title !=null?day.title : filterType(day.type, day)}}
														</text>
													</view>
													
												</view>
												<view class="">
													<view v-if="day.hotel&& day.hotel !=null" class="text-12 color_3e mb-10">
														入住酒店：{{day.hotel}}
													</view>
													<view v-if="day.address" class="text-12 color_3e mb-10">
														{{filterAddressType(day.type,day)}}
													</view>
													<!-- <view v-if="day.scenics" class="text-12 color_3e mb-10">
														<view class="mb-5">
															您将游览以下景区：
														</view>
														<view class="mb-5 color-51" v-for="(scenic,indexs) in JSON.parse(day.scenics)" :key="indexs">
															{{indexs+1}}.{{scenic.name}}
														</view>
													</view> -->
													
													<view v-if="day.journey_image&& day.journey_image !=null &&  day.journey_image !='[]'" class="">
														<scroll-view scroll-x="true" style="height: 65px;">
															<view class="display-flex display-flex-align-center">
																<view v-for="(jimg,indexj) in JSON.parse(day.journey_image)" :key="indexj">
																	 <image class="br-8 ml-5"  :src="jimg" style="width: 60px;height: 60px;"></image>
																</view>
															</view>
															
														</scroll-view>
													</view>
													<text v-if="day.content && day.content !=null" class="text-12 color_3e mb-10 line-heiht16 day-centent">
														{{day.content}}
													</text>
													<view v-if="day.take_time_hour||day.take_time_min" class="text-12 color_3e display-flex display-flex-align-center mt-10">
														<text class="iconfont icon-ic_clock2 mr-5 "></text>
														<text>{{filterTimeType(day.type,day)}}</text>
													</view>
													<view v-if="day.reminder && day.reminder!=null" class="text-12 color_3e display-flex mt-10">
														<text class="iconfont icon-wenxintishi mr-5 "></text>
														<text class="day-centent">{{day.reminder}}</text>
													</view>
												</view>
												<view class="route-detail-boder-left">
													
												</view>
											</view>
										</view>
										<view v-if="!days.show" @click="showRouteDay(indexDay)" class="route-detail-hide">
											<text>展开</text>
											<text  class="iconfont icon-ic_down" ></text>
										</view>
										<view v-if="days.show" @click="hideRouteDay(indexDay)"  class="route-detail-hide">
											<text>收起</text>
											<text class="iconfont icon-ic_up"></text>
										</view>
									</view>
								
								</view>
								
							</view>
						</view>
						<!-- 行程介绍 -->
						
						<!-- 费用须知 -->
						<view  v-if="storeInfo.productYesFee || storeInfo.productNoFee "  class='article product-intro ml-10 mr-10 mt-10' id="past2">
							<view class="pad20">
								<view   class="">
									<view class='title'>费用须知</view>
									<view class="mb-20" v-if="storeInfo.productYesFee && storeInfo.productYesFee.length">
										<view class="cost-table">
											<view class="cost-table-title">
												<text class="iconfont icon-a-ic_CompleteSelect text-black text-14" ></text>
												<text class="ml-5 text-14">费用包含</text>
											</view>
											<view class="cost-table-td" v-for="(fee,indexf) in storeInfo.productYesFee" :key="indexf">
												<view class="cost-table-td-left ft-w500">
													{{fee.title}}
												</view>
												<view class="cost-table-td-right color-66">
													{{fee.value}}
												</view>
											</view>
										</view>
									</view>
									<view class="mb-20" v-if="storeInfo.productNoFee && storeInfo.productNoFee.length">
										<view  class="cost-table">
											<view class="cost-table-title">
												<text class="iconfont icon-ic_close1 text-black text-14" ></text>
												<text class="ml-5 text-14">费用不包含</text>
											</view>
											<view class="cost-table-td" v-for="(nofee,indexno) in storeInfo.productNoFee" :key="indexno">
												<view class="cost-table-td-left ft-w500">
													{{nofee.title}}
												</view>
												<view class="cost-table-td-right color-66">
													{{nofee.value}}
												</view>
											</view>
										</view>
									</view>
								
								</view>
							</view>
						</view>
						<!-- 费用须知 -->
						
						<!-- 预定须知 -->
						<view v-if="storeInfo.productLimit.length||storeInfo.productRefundRate.length||storeInfo.productRefundRule.content||storeInfo.productBookDesc.content" class='article product-intro ml-10 mr-10 mt-10' id="past3">
							<view class="pad20">
								<view v-if="storeInfo.productLimit && storeInfo.productLimit.length"  class="">
									<view class='title'>预定限制</view>
									<view class="mb-20">
										<view class="cost-table">
											<!-- 1儿童限制2年龄限制3人群限制 -->
											<view class="cost-table-td" v-for="(limit,indexl) in storeInfo.productLimit" :key="indexl">
												<view class="cost-table-td-left ft-w500" style="background: #efeff4;">
													{{filterLimitType(limit.type)}}
												</view>
											<view class="cost-table-td-right color-66">
													{{limit.value}}
												</view>
											</view>
										</view>
									</view>
								</view>
								<view v-if="storeInfo.productRefundRate && storeInfo.productRefundRate.length"  class="">
									<view class='title'>退改规则</view>
									<view class="mb-20">
										<view class="cost-table">
											<!-- 1儿童限制2年龄限制3人群限制 -->
											<view class="cost-table-td">
												<view class="cost-table-td-left color-66 ft-w500" style="width: 200px;background: #efeff4;">
													取消时间
												</view>
												<view class="cost-table-td-right color-66 ft-w500" style="background: #efeff4;">
													损失费用
												</view>
											</view>
											<view class="cost-table-td" v-for="(refundRate,indexl) in storeInfo.productRefundRate" :key="indexl">
												<view class="cost-table-td-left ft-w500" style="width: 200px">
													{{filterRefund(refundRate)}}
												</view>
												<view class="cost-table-td-right color-66">
													{{refundRate.value}}%
												</view>
											</view>
										</view>
									</view>
								</view>
								<view v-if="storeInfo.productRefundRule && storeInfo.productRefundRule.content" class="mt-10 mb-20">
									<view class="mb-5">
										<text class="color-red">*</text>退改特别说明：
									</view>
									<view class="">
										<jyf-parser  :domain='domain' :html="storeInfo.productRefundRule.content.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
									</view>
								</view>
								<view v-if="storeInfo.productBookDesc && storeInfo.productBookDesc.content" class="mt-10 mb-20">
								    <view class='title'>预定须知</view>
									<view class="">
										<jyf-parser  :domain='domain' :html="storeInfo.productBookDesc.content.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
									</view>
								</view>
							</view>
						</view>
						<!-- 预定须知 -->
						<!-- 用户评价 -->
						<view class='article userEvaluation boder-24 pad20 ml-10 mr-10' id="past4">
							<view class='title acea-row row-between-wrapper skeleton-rect'>
								<view>用户评价({{replyCount}})</view>
								<navigator class='praise' hover-class='none' :url='"/pages/users/goods_comment_list/index?product_id="+id'>
									<text class='t-color'>{{replyChance}}</text>好评率
									<text class='iconfont icon-ic_right'></text>
								</navigator>
							</view>
							<block >
								<userEvaluation :reply="reply" :oneLine="true"></userEvaluation>
							</block>
						</view>
						<!-- 用户评价 -->
						
						<view class="content-height"></view>
					</view>	
	
					
				</view>
			</view>
			<view class='footer acea-row display-flex-align-center' :class="{'footpl':hide_mer_status==1}">
				<block >
					<view  class="item skeleton-rect w-30 mr-20" @click="goHome">
						<view class="iconfont icon-ic_home"></view>
						<view>首页</view>
					</view>
				</block>
				<block v-if="storeInfo.merchant">
					<view  class="item skeleton-rect w-30 mr-20">
						<kefu></kefu>
						<view>客服</view>
					</view>
				</block>
				<view v-if="storeInfo.stock != 0 || dateList.length != 0" class='bnt acea-row skeleton-rect'>
					<form @submit="goBuy" report-submit='true'  style="flex: 1 1 0%;">
						<button class='buy bnts'  form-type="submit" >立即预定</button>
					</form>
				</view>
				<view v-else class='bnt acea-row skeleton-rect'>
					<form report-submit='true'>
						<button  class='buy bnts sold_out' form-type="submit" disabled>产品已售罄</button>
					</form>
				</view>
			</view>
		<!-- 	<block v-if="promoter.is_show==1">
				<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet" @closeChange="closeChange"
				 :showAnimate="showAnimate" @boxStatus="boxStatus"></shareRedPackets>
			</block> -->
			<!-- 组件 -->
			<!-- 组件 -->
			<productTourWindow :attr="attr" :isShow='1' :iSplus='1' :productType="storeInfo.type" @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum"
			 @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window' :payLimit="pay_limit" :maxCount="max_count" :minCount="min_count" :svipPrice="svipPrice" :image="storeInfo.image"></productTourWindow>
			
			<block v-if="coupon.coupon">
				<couponListWindow :coupon='coupon' @ChangCouponsClose="ChangCouponsClose" @ChangCoupons="ChangCoupons"
				 @ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
			</block>
			<specs :specsInfo="specsInfo" @myevent="mySpecs"></specs>
	
			<!-- 分享按钮 -->
			<view class="generate-posters-new pb-safe" :class="posters ? 'on' : ''">
				<view class="generateCon acea-row row-middle">
					<!-- #ifdef H5 -->
					<button class="item" hover-class="none" v-if="weixinStatus === true"
						@click="H5ShareBox = true">
						<view class="pictrue">
							<image src="../static/images/weixin.png"></image>
						</view>
						<view class="">分享给好友</view>
					</button>
					<!-- #endif -->
					<!-- #ifdef MP -->
					<button class="item" open-type="share" hover-class="none">
						<view class="pictrue">
							<image src="../static/images/weixin.png"></image>
						</view>
						<view class="">分享给好友</view>
					</button>
					<!-- #endif -->
					<!-- #ifdef APP-PLUS -->
					<view class="item" @tap="appShare('WXSceneSession')">
						<view class="pictrue">
							<image src="../static/images/weixin.png"></image>
						</view>
						<view class="">分享给好友</view>
					</view>
					<view class="item" @tap="appShare('WXSenceTimeline')">
						<view class="pictrue">
							<image src="../static/weixinCircle.png"></image>
						</view>
						<view class="">分享朋友圈</view>
					</view>
					<!-- #endif -->
					<view class="item" @tap="getpreviewImage">
						<view class="pictrue">
							<image src="../static/images/changan.png"></image>
						</view>
						<view class="">预览发图</view>
					</view>
					<!-- #ifndef H5  -->
					<button class="item" hover-class="none" @tap="savePosterPath">
						<view class="pictrue">
							<image src="../static/images/haibao.png"></image>
						</view>
						<view class="">保存海报</view>
					</button>
					<!-- #endif -->
				</view>
				<view class="generateClose display-flex display-flex-align-center display-flex-justify-center" @tap="posterImageClose">取消</view>
			</view>
			
			
			<view class="mask_transparent" v-if="currentPage" @touchmove="hideNav" @click="hideNav()"></view>
			<!--口令复制结果-->
			<copyPassword :isCopy='isCopy' :copyUrl='copyUrl' @close="closeCopy"></copyPassword>
			
			
			<div class="fixed-center" v-if="posters && !posterImageStatus">
				<image class="poster-loading" :src="domain + '/static/images/poster_loading.png'" mode="widthFix" ></image>
			</div>
			<!-- 海报展示 -->
			<view class="poster-mask" v-if="posterImageStatus || posters" @click="posterImageClose"></view>
			<view class="poster-pop" v-if="posterImageStatus">
				<image :src="posterImage"></image>
			</view>
			<canvas class="canvas" canvas-id="myCanvas" v-if="canvasStatus"></canvas>
			<view class="share-box" v-if="H5ShareBox">
				<image :src="`${domain}/static/images/share-info.png`" @click="H5ShareBox = false"></image>
			</view>
	
			
			<uni-popup ref="bindmobile" type="bottom">
				
				<!-- <calendar :salesDates="calendarDates"  @callback="dateChange" >
				</calendar>
				 -->
				 <view class="" style="height: 500px;">
				 	<calendar :salesDates="dateList" :start-date="startDate" @callback="dateChange" @colseCal="colseCal">
				 	</calendar>
				 </view>
			</uni-popup>
			<backTop   :scrollTop="scrollY" @setScrollTop="backToTop"></backTop>
		</view>
	</view>
</template>

<script>
	import util from '@/utils/util.js';
	var sysHeight = uni.getSystemInfoSync().statusBarHeight;
	import { arrivalSubscribe } from '@/utils/SubscribeMessage.js';
	import {
		getProductDetail,
		getProductParmas,
		getProductCode,
		collectAdd,
		collectDel,
		postCartTourAdd,
		arrivalNoticeApi,
		copyPasswordApi, getDiscountsLst, priceRuleApi
	} from '@/api/store.js';
	import { getUserInfo, imgToBase } from '@/api/user.js';
	import { getCoupons,getShopCoupons } from '@/api/api.js';
	import { getCartCounts } from '@/api/order.js';
	import { mapGetters } from "vuex";
	import { configMap, getCustomer } from "@/utils";
	import { imageBase64 } from "@/api/public";
	import productConSwiper from '@/components/productConSwiper';
	import couponListWindow from '@/components/couponListWindow';
	import copyPassword from '@/components/copyPassword';
	import productTourWindow from '@/components/productTourWindow';
	import userEvaluation from '@/components/userEvaluation';
	import shareRedPackets from '@/components/shareRedPackets';
	import specs from '@/components/specs/index.vue';
	import Cache from '@/utils/cache';
	import { toLogin } from '@/libs/login.js';
	// #ifndef H5
	import passwordPopup from '@/components/passwordPopup';
	// #endif
	import { HTTP_REQUEST_URL } from '@/config/app';
	import { CART_TIME,CART_ID} from '@/config/cache';
	import { silenceBindingSpread } from "@/utils";
	import parser from "@/components/jyf-parser/jyf-parser";
	import shareScence from "@/libs/spread";
	import guaranteeTemplate from '@/components/freightGuarantee';
	import discountsGoods from './discountsGoods';
	import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
	import calendarSwiper from "@/components/calendar_swiper/index.vue"
	import calendar from '@/components/calendar/index'
	import backTop from '@/components/back-top/back-top.vue';
	let app = getApp();
	export default {
		components: {
			// #ifndef H5
			passwordPopup,
			// #endif
			productConSwiper,
			couponListWindow,
			productTourWindow,
			userEvaluation,
			shareRedPackets,
			guaranteeTemplate,
			copyPassword,
			discountsGoods,
			"jyf-parser": parser,
			easyLoadimage,
			specs,
			calendarSwiper,
			calendar,
			backTop,
		},
		data() {
			let that = this;
			return {
				showSkeleton: true, //骨架屏显示隐藏
				isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
				sysHeight: sysHeight, //系统导航条高度
				//属性是否打开
				coupon: {
					'coupon': false,
					list: [],
				},
				attrTxt: '选择', //属性页面提示
				attrValue: '', //已选属性
				animated: false, //购物车动画
				id: 0, //产品id
				replyCount: 0, //总评论数量
				reply: [], //评论列表
				storeInfo: {
					merchant: {}
				}, //产品详情
				productValue: [], //系统属性
				couponList: [], //优惠券
				cart_num: 1, //购买数量
				isOpen: false, //是否打开属性组件
				actionSheetHidden: true,
				posterImageStatus: false,
				storeImage: '', //海报产品图
				PromotionCode: '', //二维码图片
				canvasStatus: false, //海报绘图标签
				posterImage: '', //海报路径
				posterbackgd: '/static/images/posterbackgd.png',
				source: '',
				sharePacket: {
					isState: true, //默认不显示
				}, //分销商详细
				// uid: 0, //用户uid
				circular: false,
				autoplay: false,
				interval: 3000,
				duration: 500,
				swiperCur: 0,
				clientHeight: "",
				systemStore: {}, //门店信息
				replyChance: 0,
				CartCount: 0,
				storeSelfMention: true,
				posters: false,
				weixinStatus: false,
		
				description: {},
				navActive: 0,
				H5ShareBox: false, //公众号分享图片
				activity: [],
				retunTop: true, //顶部返回
				
				opacity: 0,
				scrollY: 0,
				topArr: [],
				toView: '',
				height: 0,
				heightArr: [],
				lock: false,
				scrollTop: 0,
				tagStyle: {
					img: 'width:100%;display:block;'
				},
				// 动画状态
				showAnimate: true,
				domain: HTTP_REQUEST_URL,
				currSpid: '',
				codeImg: "",
				videoCoverImg: "",
				shipping: "",
				guarantee: [],
				shippingValue: "",
				uniqueValue: "",
				priceRule: "",
				isCopy: false,
				copyUrl: '',
				comboTotal: 0,
				comboList: [],
				max_count: 0,
				min_count: 0,
				pay_limit: 1,
				svipData: {},
				svipPrice: false,
				specsInfo: {
				  show: false,
				  params: []
				},
				recommend: [],
				serviceInfo: {},
				promoter: {
					
				},
				isOpen: false, //是否打开属性组件
				currentPage: false,
				homeTop: 59,
				marketPrice: "",
				selectNavList: [{
						name: '首页',
						icon: 'icon-ic_home',
						url: '/pages/index/index',
						after: 'dialog_after'
					},

					{
						name: '我的收藏',
						icon: 'icon-ic_star',
						url: '/pages/users/user_goods_collection/index',
						after: 'dialog_after'
					},
					{
						name: '个人中心',
						icon: 'icon-ic_user',
						url: '/pages/user/index'
					},
				],
				routeDays: [],
				dptDate: '',
				preSaleDate: '',
				calendarDates:'',
				dateList: [],
				selectDay: '',
				navH: "",
				navList: [],
				navTitle: '',
				navTitleShow: false,
				tempDateSwiper: {},
				startDate: '',
				subFlag: false,
				attr: {
					cartAttr: false,
					productAttr: [],
					productSelect: {}
				},
				scrollList: [], // 文章的滚动参数
				scrollLeftList: [], // tab栏滚动参数
				arcHeight: 0, // 文章滚动区域高度
				arcWidth: 0, // tab栏滚动区域宽度
				isRun: false ,// 是否正在滚动
				scrollTop: 0,
			};
		},
		computed:{
			...configMap(['margin_ico_switch','margin_ico','hide_mer_status','procudt_increase_status','site_name','share_pic'], mapGetters(['isLogin','uid','viewColor'])),
		},
		onLoad(options) {
			
			let that = this
			
		
			
		
			if (options.spid) {
				app.globalData.spid = options.spid;
				that.currSpid = options.spid
			}
			var pages = getCurrentPages();
			let curPage = pages[pages.length - 1];
			if (pages.length <= 1) {
				that.retunTop = false
			}
			let curParam = curPage.options || curPage.$route.query;
			that.source = curParam.source;
			
			uni.getSystemInfo({
				success: function(res) {
					console.log('res',res)
					that.navH = res.statusBarHeight * (750 / res.windowWidth) + 100;
					// that.navH = app.globalData.navHeight+10;
					console.log('that.navH',that.navH)
				}
			});
		
			//页面中需要计算的一些值
			// #ifdef APP-PLUS
			that.homeTop = (that.sysHeight + 8)*2;
			// #endif
			// #ifdef H5
			that.homeTop = 10;
			// #endif
			that.id = options.id;
			uni.getSystemInfo({
				success: function(res) {
					that.height = res.windowHeight
					//res.windowHeight:获取整个窗口高度为px，*2为rpx；98为头部占据的高度；
					that.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
				},
			});
			//扫码携带参数处理
			// #ifdef MP
			if (options.scene) {
				let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
				if (value.id) options.id = value.id;
				//记录推广人uid
				if (value.spid) {
					app.globalData.spid = value.spid;
					that.currSpid = value.spid
				}
			}
			if (!options.id && !options.scene) {
				setTimeout(() => {
					this.showSkeleton = false
				}, 200)
				return this.$util.Tips({
					title: '缺少参数无法查看产品'
				}, {
					tab: 3,
					url: 1
				});
			} else {
				this.id = options.id
			}
			//记录推广人uid
			if (options.spid) app.globalData.spid = options.spid;
			// #endif
			shareScence(that.currSpid, that.isLogin)
			this.getGoodsDetails();
			// this.getDiscountsData();
			//#ifdef H5
			this.isLogin && silenceBindingSpread();
			//#endif
		},
		onReady() {
			var that = this;
			this.isNodes++;
			this.$nextTick(function() {
				// #ifdef MP-WEIXIN
				const menuButton = uni.getMenuButtonBoundingClientRect();
				const query = uni.createSelectorQuery().in(this);
				query
					.select('#home')
					.boundingClientRect(data => {
						console.log('data',data)
						this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
					})
					.exec();
				// #endif
			});
			
		},
		onShow() {
			let that = this
			// that.getConfig();
			uni.hideLoading();
		},
		/**
		 * 用户点击右上角分享
		 */
		// #ifdef MP-WEIXIN
		onShareAppMessage: function() {
			let that = this;
			that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
			return {
				title: that.storeInfo.store_name || '',
				imageUrl: that.storeInfo.image || '',
				path: '/pages/goods_details/index?id=' + that.id + '&spid=' + that.uid,
			}
		},
		onShareTimeline: function() {
			let that = this;
			that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
			return {
				title: that.storeInfo.store_name || '',
				query: {
					id: that.id,
					spid: that.uid
				},
				imageUrl: that.storeInfo.image || ''
			}
		},
		// #endif
		onPageScroll(e) {
			// console.log(123,e)
			var that = this,
			scrollY = e.scrollTop;
			that.scrollTop =  e.scrollTop;
			
			var opacity = scrollY / 200;
			opacity = opacity > 1 ? 1 : opacity;
			that.$set(that, 'showAnimate', false);
			that.$set(that, 'opacity', opacity);
			that.$set(that, 'scrollY', scrollY);
			// console.log('opacity',opacity)
			
			
			if (that.isRun) {
				return;
			}
			// 如果某一个元素接近顶部,触发tab切换效果
			for (let i = 0; i < that.scrollList.length; i++) {
				if (e.scrollTop + 50 >= that.scrollList[i] && e.scrollTop - 50 <= that.scrollList[i]) {
					that.tabClick(i);
					return;
				}
			}
			
			 const query = uni.createSelectorQuery();
			  query.select('#navTabFlag').boundingClientRect(data => {  
				// 注意：这里的 data.scrollTop 可能并不总是准确的，特别是在某些平台上  
				// 因为小程序的滚动事件处理可能有所不同。  
				// 但为了示例，我们假设它可以工作，并检查 scrollTop 是否为 0。  
				if (data.top <= that.navH/2) {  
				  
				  this.navTitleShow = true;
				  // 在这里处理滚动到顶部的事件  
				}  else {
				   this.navTitleShow = false;
				}
			  }).exec();  
			  
			  
		},
		methods: {
			parserLoad(){
				console.log('parserLoad')
				var that= this
				setTimeout(function() {
					that.$nextTick(() => {
						// that.infoScroll();
					});
					
				}, 500);
			},
			handlerCalendar:function(t){
				this.selectDay = t.currentDate;	
				console.log('this.selectDay',this.selectDay)
				
				this.startDate = this.selectDay
			},
			
			handlerAllCalendar:function(){
				this.$refs.bindmobile.open()
			},
			dateChange:function(date){
				var that = this;
				this.selectDay = date.startStr.dateStr;	
				console.log('this.selectDay',this.selectDay)
				
				const found = this.dateList.find(function(element) {  
				  return that.selectDay == element.date;  
				}); 
		
				if(found != undefined){
					this.tempDateSwiper = {
						date: that.selectDay,
						price: found.price
					};
				}

				this.$refs.bindmobile.close()
			},
			colseCal(){
				this.$refs.bindmobile.close()
			},
			call: function(){
				let that = this;
				if(that.storeInfo.merchant.service_phone){
					uni.showModal({
						title: '提示',
						content: '暂无在线客服，确定拨打客服电话:'+that.storeInfo.merchant.service_phone+'吗？',
						success: function(res) {
							if (res.confirm) {
								uni.makePhoneCall({
									// 手机号
								    phoneNumber: that.storeInfo.merchant.service_phone,
									// 成功回调
									success: (res) => {},
									// 失败回调
									fail: (res) => {}
								});
							}
						}
					})
				}else{
					return that.$util.Tips({
						title: '暂无可用客服'
					})
				}
			},
			getConfig() {
				let self = this
				// 获取配置
				getconfig().then(res => {
			
				}).catch(err => {})
			},
			/**到货通知*/
			arrivalNotice(){
				let that = this;
				// #ifdef MP
				arrivalSubscribe().then((res) => {
					that.arrivalNoticeFun();
				}).catch(err => {
					console.log(err)
				});
				// #endif
				// #ifndef MP
				that.arrivalNoticeFun();
				// #endif
			},
			arrivalNoticeFun(){
				let that = this;
				let uniqueValue = that.uniqueValue;
				let typeValue = 0;
				// #ifdef MP
				typeValue = 3
				// #endif
				// #ifdef H5
				if(this.$wechat.isWeixin() === true){
					typeValue = 2
				}else{
					typeValue = 1
				}
				// #endif
				arrivalNoticeApi({ unique: uniqueValue,type:typeValue,product_id: that.id }).then(res => {
					return that.$util.Tips({
						title: res.message
					})
				}).catch(err => {
					//状态异常返回上级页面
					return that.$util.Tips({
						title: err
					})
				})
			},
			goProDetail(item) {
				uni.redirectTo({
					url: '/pages/goods_details/index?id=' + item.product_id
				})
			},
			backToTop(){
				console.log(123,this.scrollTop)
				var that = this;
				
				//  //视图会发生重新渲染
				// this.scrollTop = this.scrollY
				// //当视图渲染结束 重新设置为0
				// this.$nextTick(() =>{
				// 	this.scrollTop = 0
				// });
				// // uni.showToast({
				// // 	icon:"none",
				// // 	title:"纵向滚动 scrollTop 值已被修改为 0"
				// // })
				
				// // this.$set(this, 'scrollTop', 0);
				// // this.$set(this, 'scrollTop', 0);
				// uni.pageScrollTo({
				//     duration: 300,
				//     selector: "#past0" // string 选择器
				// });
				uni.pageScrollTo({
					scrollTop: that.scrollList[0],
					complete: function() {
						that.isRun = false;
					}
				});
			},
			//下拉导航页面跳转
			linkPage(url) {
				if (['/pages/index/index', '/pages/order_addcart/order_addcart',
						'/pages/user/index', '/pages/plant_grass/index'
					].indexOf(url) > -1) {
					uni.switchTab({
						url
					})
				} else {
					uni.navigateTo({
						url
					})
				}
				this.currentPage = false
			},
			boxStatus(data) {
				this.showAnimate = data
			},
			closeChange: function() {
				this.$set(this.sharePacket, 'isState', true);
			},
			showNav() {
				this.currentPage = !this.currentPage;
			},
			hideNav() {
				this.currentPage = false;
			},
			/**查看运费说明*/
			showShip: function() {
				this.$refs.guartemplate.showShippingTel();
			},
			/**查看服务保障*/
			showGuaranee: function() {
				this.$refs.guartemplate.showGuaranteeTel();
			},
			/*查看套餐详情*/
			openCombo(){
				this.$refs.discounts.showPopup(this.id);
			},
			seeSpecs() {
			  this.specsInfo.show = true;
			},
			mySpecs() {
			  this.$set(this.specsInfo, 'show', false);
			},
			/*获取套餐列表数据*/
			getDiscountsData(){
				getDiscountsLst({product_id: this.id}).then(res => {
					this.comboTotal = res.data.count;
					res.data.list.forEach((item, index) => {
						item.save_price = 0;
						item.discountsProduct.forEach((v, i) => {
							item.save_price += parseFloat(v.product.ot_price) - parseFloat(v.product.price)
						})
					})
				    this.comboList = res.data.list;
				}).catch(err => {

				});
			},
			
			goPage(type, url){
				if(type == 1){
					uni.navigateTo({
						url
					})
				}else if(type == 2){
					uni.switchTab({
						url
					})
				}else if(type == 3){
					uni.navigateBack();
				}
			
			},
			
			/*获取价格说明*/
			getPricrRule() {
				priceRuleApi(this.storeInfo.cate_id).then(res => {
					this.priceRule = res.data
				}).catch(err => {

				});
			},
			goActivity: function(e) {
				let item = e;
				if (item.type === "1") {
					uni.navigateTo({
						url: `/pages/activity/goods_seckill_details/index?id=${item.id}&time=${item.time}&status=1`
					});
				} else if (item.type === "2") {
					uni.navigateTo({
						url: `/pages/activity/goods_bargain_details/index?id=${item.id}&bargain=${this.uid}`
					});
				} else {
					uni.navigateTo({
						url: `/pages/activity/goods_combination_details/index?id=${item.id}`
					});
				}
			},
		
			// 后退
			returns: function() {
				uni.navigateBack()
			},
			// 首页
			goHome() {
				uni.switchTab({
					url: '/pages/index/index'
				});
			},
			// 种草详情
			goPlant(item){
				if(item.is_type == 1){
					uni.navigateTo({
						url: '/pages/plantGrass/plant_detail/index?id='+item.community_id
					});
				}else{
					uni.navigateTo({
						//#ifdef APP
						url: '/pages/short_video/appSwiper/index?id='+item.community_id+'&tab=1'
						//#endif
						//#ifndef APP
						url: '/pages/short_video/nvueSwiper/index?id='+item.community_id+'&tab=1'
						//#endif
					});
				}
			},
			tapNav: function(index) {
				let that = this;
				
				if (that.isRun) {
					return;
				}
				
				that.tabClick(index);
				that.isRun = true;
				
				// 滚动到指定文章的高度
				uni.pageScrollTo({
					scrollTop: that.scrollList[index],
					complete: function() {
						that.isRun = false;
					}
				});
		
			},
			// 改变tab栏显示参数
			tabClick(index) {
				let that = this;
				that.navActive = index;
			},
			initTab() {
				let that = this;
		
	         	console.log('initTab')
				// 获取渲染完成后的各个元素滚动参数
				setTimeout(function() {
					// 文章列表参数
					const query = uni.createSelectorQuery();
					query.selectAll('.artbox > .article').boundingClientRect();
					query.exec(function(res) {
						console.log(res[0]);
						let items = res[0];
						let scrollList = [];
						for (let i in items) {
							let nowS = 0;
							nowS = items[i].top - that.navH + 30;
							scrollList.push(nowS);
						}
						that.scrollList = scrollList;
						console.log(scrollList);
					});
			
					
					
				}, 100);
			},
			
			scroll: function(e) {
				// var that = this,
				// scrollY = e.detail.scrollTop;
				
				
				// var opacity = scrollY / 200;
				// opacity = opacity > 1 ? 1 : opacity;
				// that.$set(that, 'showAnimate', false);
				// that.$set(that, 'opacity', opacity);
				// that.$set(that, 'scrollY', scrollY);
	   //         // console.log('scrollY',that.scrollY)
				//  const query = uni.createSelectorQuery().in(this);  
				//       query.select('#navTabFlag').boundingClientRect(data => {  
				//         // 注意：这里的 data.scrollTop 可能并不总是准确的，特别是在某些平台上  
				//         // 因为小程序的滚动事件处理可能有所不同。  
				//         // 但为了示例，我们假设它可以工作，并检查 scrollTop 是否为 0。  
				//         if (data.top <= that.navH/2) {  
						  
				// 		  this.navTitleShow = true;
				//           // 在这里处理滚动到顶部的事件  
				//         }  else {
				// 		   this.navTitleShow = false;
				// 		}
				//       }).exec();  
				
				// if (that.lock) {
				// 	that.$set(that, 'lock', false)
				// 	return;
				// }
				// for (var i = 0; i < that.topArr.length; i++) {
				// 	if (scrollY < that.topArr[i] - (app.globalData.navHeight / 2) + that.heightArr[i]) {
				// 		that.$set(that, 'navActive', i)
				// 		break
				// 	}
				// }
				// uni.$emit('scroll');
			},
			ChangCouponsClose: function() {
				this.$set(this.coupon, 'coupon', false)
			},
		  
			/**
			 * 领取完毕移除当前页面领取过的优惠券展示
			 */
			ChangCoupons: function(e) {
				let coupon = e;
				let couponList = this.$util.ArrayRemove(this.couponList, 'id', coupon.id);
				this.$set(this, 'couponList', couponList);
				this.getCouponList();
			},
			setClientHeight: function() {
				let that = this;
				let view = uni.createSelectorQuery().in(this).select("#list0");
				view.fields({
					size: true,
				}, data => {
					that.$set(that, 'clientHeight', data.height + 20)
				}).exec();
			},
			showRouteDay(index){
				let that = this;
				that.$set(that.routeDays[index], 'show', true)
				console.log(11,this.routeDays[index])
				that.$forceUpdate();

			},
			hideRouteDay(index){
				let that = this;
				that.$set(that.routeDays[index], 'show', false)
				console.log(22,this.routeDays[index])
				that.$forceUpdate();

			},
			/**
			 * 获取产品详情
			 *
			 */
			getGoodsDetails: function() {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				let that = this;
				getProductDetail(that.id).then(res => {
					uni.hideLoading();
					let storeInfo = res.data;
					if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
						this.videoCoverImg = storeInfo.slider_image[0]
						storeInfo.slider_image.splice(0, 1)
					} else if (storeInfo.video_link && storeInfo.slider_image.length === 1) {
						this.videoCoverImg = storeInfo.slider_image[0]
					}
					that.$set(that, 'storeInfo', storeInfo);
					that.$set(that, 'reply', res.data.topReply ? [res.data.topReply] : []);
					that.$set(that, 'replyCount', res.data.replayData && res.data.replayData.count);
					that.$set(that, 'replyChance', res.data.replayData && res.data.replayData.rate);
					that.$set(that.attr, 'productAttr', res.data.attr);
					that.$set(that, 'productValue', res.data.sku);
					that.$set(that, 'promoter', res.data.promoter);
					that.$set(that.sharePacket, 'max', res.data.max_extension);
					that.$set(that.sharePacket, 'min', res.data.min_extension);
					that.$set(that, 'systemStore', res.data.system_store);
					that.$set(that, 'storeSelfMention', res.data.store_self_mention);
					that.$set(that, 'PromotionCode', storeInfo.code_base);
					that.$set(that, 'activity', res.data.activity ? res.data.activity : []);
					that.$set(that, 'max_count', res.data.once_max_count);
					that.$set(that, 'pay_limit', res.data.pay_limit);
					that.$set(that, 'min_count', res.data.once_min_count);
					that.$set(that, 'svipData', res.data.show_svip_info || null);		
					that.$set(that, 'svipPrice', res.data.show_svip_info && res.data.show_svip_info.show_svip_price || false);							
				
				    if(res.data.productRoute.length){
						that.$set(that,'routeDays',res.data.productRoute[0]['productRouteDay'])
					}
					
					
					
					
					
					if(this.routeDays&&this.routeDays.length){
						for(var i = 0; i < this.routeDays.length; i++){
							this.routeDays[i].show = false;
						}
					}
					if(this.routeDays&&this.routeDays.length==1){
						this.routeDays[0].show = true;
					}
					
					this.dateList = this.storeInfo.price_date_data;
					for(var i = 0; i < this.dateList.length; i++){
						if(this.dateList[i].stock <= 0){
							this.dateList.splice(i,1)
						}
						this.dateList[i].price = this.dateList[i].adult_price
					}
					// 默认选择日期 util.formatDate("yyyy-MM-dd")
					this.selectDay =  this.dateList.length ? this.dateList[0]['date'] : '';
					console.log('this.dateList',this.dateList)
					// uni.setNavigationBarTitle({
					// 	title: storeInfo.store_name.substring(0, 7) + "..."
					// })
					this.navTitle = storeInfo.store_name.substring(0, 8) + "...";
					that.$set(that, 'storeImage', that.storeInfo.image);
					
					getProductParmas(that.id).then((res) => {
						that.$set(that, 'description', res.data.content);
						if (that.description&&that.description.type == 0) {
							// that.description.content = that.description.content.replace(
							// 	/<img/gi,
							// 	'<img style="max-width:100%;height:auto;float:left;display:block" '
							// );
							that.description.content = that.description.content.replace(
								/<video/gi,
								'<video style="width:100%;height:300px;display:block" '
							);
						}
						
						// '详情', '行程', '费用','须知','评价'
						
						let navList= [];
						if(that.description){
							navList.push('详情')
						}
						if(that.routeDays && that.routeDays.length){
							navList.push('行程')
						}
						if(that.storeInfo.productYesFee || that.storeInfo.productNoFee){
							navList.push('费用')
						}
						if(that.storeInfo.productLimit.length||that.storeInfo.productRefundRate.length||that.storeInfo.productRefundRule.content||that.storeInfo.productBookDesc.content){
							navList.push('须知')
						}
						navList.push('评价')
						// let navList =['详情', '行程', '费用','须知','评价'];
										
						this.$set(this, 'navList', navList);
						
						
						setTimeout(() => {
							this.showSkeleton = false
							    this.initTab();
						}, 200)
						
						that.$set(that, 'guarantee', res.data.guarantee ? res.data.guarantee : []);
						that.$set(that, 'shippingValue', res.data.temp ? res.data.temp.name : '');
						that.$set(that, 'shipping', res.data.temp ? res.data.temp.info : '');
						that.$set(that.specsInfo, 'params', res.data.params);	
						that.$set(that.storeInfo, 'merchant', res.data.merchant);	
						that.$set(that.storeInfo, 'spu_id', res.data.spu_id);	
						that.$set(that.storeInfo, 'community', res.data.community);	
						that.$set(that.storeInfo, 'atmosphere_pic', res.data.atmosphere_pic);	
						that.$set(that.storeInfo, 'top_pid', res.data.top_pid);	
						that.$set(that.storeInfo, 'top_num', res.data.top_num);	
						that.$set(that.storeInfo, 'top_name', res.data.top_name);	
						var recommendArr = [];
						for(var i=0,len=res.data.merchant.recommend.length;i<len;i+=6){
							recommendArr.push(res.data.merchant.recommend.slice(i,i+6));
						}
						that.recommend = recommendArr
					})
				if (that.isLogin) {
						// that.downloadFilePromotionCode();
						// that.getCartCount();
					};
					// #ifdef H5
					that.ShareInfo();
					// #endif
					that.DefaultSelect();
					// that.getPricrRule(that.storeInfo.cate_id)
					that.$nextTick(function() {
						that.getCouponList();
					})
					
				
					
				}).catch(err => {
					console.log('err',err)
					setTimeout(() => {
						this.showSkeleton = false
					}, 200)
					//状态异常返回上级页面
					return that.$util.Tips({
						title: err
					}, {
						tab: 3,
						url: 1
					});
				})
			},
			infoScroll: function() {
				var that = this,
					topArr = [],
					heightArr = [];
				for (var i = 0; i < that.navList.length; i++) { //productList
					//获取元素所在位置
					var query = uni.createSelectorQuery().in(this);
					var idView = "#past" + i;
				
					query.select(idView).boundingClientRect();
					query.exec(function(res) {
						console.log( 'res',res)
						console.log( i,res[0].top)
						var top = res[0].top;
						var height = res[0].height;
						topArr.push(top );
						heightArr.push(height);
						that.$set(that, 'topArr', topArr);
						that.$set(that, 'heightArr', heightArr);
					});
				};
			},
			/**
			 * 获取优惠券
			 *
			 */
			getCouponList() {
				let that = this;
				let goodsArr = []
				let couponList = [];
				let activeList = []
				getCoupons({
					ids: that.id
				}).then(res => {
					goodsArr = res.data
					getShopCoupons(that.storeInfo.mer_id).then(({
						data
					}) => {
						couponList = goodsArr.concat(data)
						that.$set(that.coupon, 'list', couponList);
						for (let i = 0; i < couponList.length; i++) {
							if (!couponList[i].issue && activeList.length < 2) {
								activeList.push(couponList[i]);
							}
						}
						that.$set(that, 'couponList', activeList);
					})
				});
			},
			ChangCouponsUseState(index) {
				let that = this;
				that.$set(that.coupon, 'coupon', false);
			},
			/**
			 *
			 *
			 * 收藏产品
			 */
			setCollect: function() {
				if (this.isLogin === false) {
					toLogin()
				} else {
					let that = this;
					if (this.storeInfo.isRelation) {
						collectDel({
							type: 0,
							type_id: this.id
						}).then(res => {
							that.$util.Tips({
								title: '已取消收藏'
							});
							that.$set(that.storeInfo, 'isRelation', !that.storeInfo.isRelation);
						}).catch(err=>{
							that.$util.Tips({
								title: err
							});
						})
					} else {
						collectAdd({
							type_id: this.id,
							type: 0
						}).then(res => {
							that.$util.Tips({
								title: '收藏成功'
							});
							that.$set(that.storeInfo, 'isRelation', !that.storeInfo.isRelation);
						}).catch(err=>{
							that.$util.Tips({
								title: err
							});
						})
					}
				}
			},
			onMyEvent: function() {
				this.$set(this.attr, 'cartAttr', false);
				this.$set(this, 'isOpen', false);
			},
			/**
			 * 打开优惠券插件
			 */
			couponTap: function() {
				let that = this;
				if (that.isLogin === false) {
					toLogin()
				} else {
					that.$set(that.coupon, 'coupon', true);
				}
			},
			goCustomer: function() {
				let that = this;
				if (that.isLogin === false) {
					toLogin()
				} else {
					let mer = that.storeInfo.merchant.services_type
					let data = {
						type: mer.services_type,
						service_phone: mer.service_phone,
						customer_url: mer.mer_customer_url,
						customer_corpId: mer.mer_customer_corpId,
						customer_link: mer.mer_customer_link
					}
					let url = `/pages/chat/customer_list/chat?mer_id=${that.storeInfo.mer_id}&uid=${that.uid}&productId=${that.id}`
					getCustomer(data, url)
				}
			},
			/**
			 * 购物车手动填写
			 *
			 */
			iptCartNum: function(e) {	
				this.$set(this.attr.productSelect, 'cart_num', e);
			},
			ChangCouponsClose: function() {
				this.$set(this.coupon, 'coupon', false)
			},
			/**
			 * 购物车数量加和数量减
			 *
			 */
			ChangeCartNum: function(changeValue) {
				//changeValue:是否 加|减
				//获取当前变动属性
				let productSelect = this.productValue[this.attrValue];
				//如果没有属性,赋值给产品默认库存
				if (productSelect === undefined && !this.attr.productAttr.length)
					productSelect = this.attr.productSelect;
				//无属性值即库存为0；不存在加减；
				if (productSelect === undefined) return;
				let stock = productSelect.stock || 0;
				let num = this.attr.productSelect;
				if (changeValue) {
					num.cart_num++;
					if (num.cart_num > stock) {
						this.$set(this.attr.productSelect, "cart_num", stock);
						this.$set(this, "cart_num", stock);
					}
					if(num.cart_num > this.storeInfo.once_max_count&&this.storeInfo.once_max_count!=0&&this.storeInfo.pay_limit!=0){
						this.$set(this.attr.productSelect, "cart_num", this.storeInfo.once_max_count);
						this.$set(this, "cart_num", this.storeInfo.once_max_count);
						return this.$util.Tips({
							title: "单次购买件数不能超过"+this.storeInfo.once_max_count+"件！"
						});
					}
				} else {
					num.cart_num--;
					if (num.cart_num < 1) {
						this.$set(this.attr.productSelect, "cart_num", 1);
						this.$set(this, "cart_num", 1);
					}
					if(num.cart_num < this.storeInfo.once_min_count&&this.storeInfo.once_min_count!=0){
						this.$set(this.attr.productSelect, "cart_num", this.storeInfo.once_min_count);
						this.$set(this, "cart_num", this.storeInfo.once_min_count);
						return this.$util.Tips({
							title: "单次购买件数不能少于"+this.storeInfo.once_min_count+"件！"
						});
					}
				}
			},
			attrVal(val) {
				this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val.indexn]);
			},
			/**
			 * 属性变动赋值
			 *
			 */
			ChangeAttr: function(res) {
				let productSelect = this.productValue[res];
				if(productSelect)this.$set(this, "uniqueValue", productSelect.unique);
				if (productSelect && productSelect.stock > 0) {
					this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this.storeInfo.image);
					this.$set(this.attr.productSelect, "price", productSelect.price);
					this.$set(this.attr.productSelect, "svip_price", productSelect.svip_price);
					this.$set(this.attr.productSelect, "stock", productSelect.stock);
					this.$set(this.attr.productSelect, "unique", productSelect.unique);
					this.$set(this.attr.productSelect, "value_id", productSelect.value_id);
					this.$set(this.attr.productSelect, "sku", productSelect.sku);
					this.$set(this, "uniqueValue", productSelect.unique);
					this.$set(this, "marketPrice", productSelect.ot_price);
					if (productSelect.stock == 0) {
						this.$set(this.attr.productSelect, "cart_num", 0);
					} else {
						this.$set(this.attr.productSelect, "cart_num", this.min_count || 1);
					}
					this.$set(this, "attrValue", res);
					this.$set(this, "attrTxt", "选择");
				}
				 else {
					this.$set(this.attr.productSelect, "image", productSelect.image);
					this.$set(this.attr.productSelect, "price", productSelect.price);
					this.$set(this.attr.productSelect, "svip_price", productSelect.svip_price);
					this.$set(this.attr.productSelect, "stock", 0);
					this.$set(this.attr.productSelect, "unique", "");
					this.$set(this.attr.productSelect, "cart_num", 0);
					this.$set(this.attr.productSelect, "value_id", productSelect.value_id);
					this.$set(this.attr.productSelect, "sku", productSelect.sku);
					this.$set(this, "marketPrice", productSelect.ot_price);
					this.$set(this, "attrValue", res);
					this.$set(this, "attrTxt", "选择");
				}
			},
			
			
			/**
			 * 默认选中属性
			 *
			 */
			DefaultSelect: function() {
				let productAttr = this.attr.productAttr;
				let value = [];
				let arr = []
				let unSortArr = []
				console.log("this.productValue",this.productValue)
				for (var key in this.productValue) {
					// if (this.productValue[key].stock > 0) {
					// 	value = this.attr.productAttr.length ? key.split(",") : [];
						
					// 	break;
					// }
					value = this.attr.productAttr.length ? key.split(",") : [];
					break;
				}
				 
			
				
				this.dptDate = this.selectDay;
				this.startDate = this.selectDay;
				
				this.preSaleDate = util.addDay(20).day
				 console.log('this.preSaleDate',this.preSaleDate)
				
				for (let i = 0; i < productAttr.length; i++) {
					this.$set(productAttr[i], "index", value[i]);
				}
				//sort();排序函数:数字-英文-汉字；
				let productSelect = this.productValue[value.join(",")];
				 console.log('productSelect',productSelect)
				if (productSelect && productAttr.length) {
					this.$set(
						this.attr.productSelect,
						"store_name",
						this.storeInfo.store_name
					);
					this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this.storeInfo.image);
					this.$set(this.attr.productSelect, "price", productSelect.price);
					this.$set(this.attr.productSelect, "svip_price", productSelect.svip_price);
					this.$set(this.attr.productSelect, "stock", productSelect.stock);
					this.$set(this.attr.productSelect, "unique", productSelect.unique);
					this.$set(this.attr.productSelect, "value_id", productSelect.value_id);
					this.$set(this.attr.productSelect, "sku", productSelect.sku);
					this.$set(this, "uniqueValue", productSelect.unique);
					this.$set(this, "marketPrice", productSelect.ot_price);
					this.$set(this, "attrValue", value.join(","));
					this.$set(this, "attrTxt", "选择");
					if (productSelect.stock == 0) {
						this.$set(this.attr.productSelect, "cart_num", 0);
					} else {
						this.$set(this.attr.productSelect, "cart_num", this.min_count || 1);
					}
				} else if (!productSelect && productAttr.length) {
					this.$set(
						this.attr.productSelect,
						"store_name",
						this.storeInfo.store_name
					);
					this.$set(this.attr.productSelect, "image", this.storeInfo.image);
					this.$set(this.attr.productSelect, "price", this.storeInfo.price);
					this.$set(this.attr.productSelect, "svip_price", this.storeInfo.svip_price);
					this.$set(this.attr.productSelect, "stock", 0);
					this.$set(this.attr.productSelect, "unique", "");
					this.$set(this.attr.productSelect, "value_id", '');
					this.$set(this.attr.productSelect, "sku",'');
					this.$set(this, "uniqueValue", "");
					this.$set(this.attr.productSelect, "cart_num", 0);
					this.$set(this, "marketPrice", this.storeInfo.ot_price);
					this.$set(this, "attrValue", "");
					this.$set(this, "attrTxt", "选择");
				} else if (!productSelect && !productAttr.length) {
					this.$set(
						this.attr.productSelect,
						"store_name",
						this.storeInfo.store_name
					);
					this.$set(this.attr.productSelect, "image", this.storeInfo.image);
					this.$set(this.attr.productSelect, "price", this.storeInfo.price);
					this.$set(this.attr.productSelect, "svip_price", this.storeInfo.svip_price);
					this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
					this.$set(this.attr.productSelect, "unique", this.storeInfo.unique || "");
					this.$set(this.attr.productSelect, "value_id", '');
					this.$set(this.attr.productSelect, "sku",'');
					this.$set(this, "uniqueValue", this.storeInfo.unique || "");
					this.$set(this, "marketPrice", this.storeInfo.ot_price);
					this.$set(this.attr.productSelect, "cart_num", 1);
					this.$set(this, "attrValue", "");
					this.$set(this, "attrTxt", "选择");
				} else if (productSelect && !productAttr.length) {
					this.$set(this.attr.productSelect, "store_name", this.storeInfo.store_name);
					this.$set(this.attr.productSelect, "image", productSelect.image);
					this.$set(this.attr.productSelect, "price", productSelect.price);
					this.$set(this.attr.productSelect, "svip_price", productSelect.svip_price);
					this.$set(this.attr.productSelect, "stock", productSelect.stock);
					this.$set(this.attr.productSelect, "unique", productSelect.unique);
					this.$set(this.attr.productSelect, "value_id", productSelect.value_id);
					this.$set(this.attr.productSelect, "sku", productSelect.sku);
					this.$set(this.attr.productSelect, "value_id", '');
					this.$set(this.attr.productSelect, "sku",'');
					this.$set(this, "uniqueValue", productSelect.unique);
					this.$set(this, "marketPrice", productSelect.ot_price);
					this.$set(this, "attrValue", value.join(","));
					this.$set(this, "attrTxt", "选择");
					if (productSelect.stock == 0) {
						this.$set(this.attr.productSelect, "cart_num", 0);
					} else {
						this.$set(this.attr.productSelect, "cart_num", this.min_count || 1);
					}
				}
			
				console.log('this.attr.productSelect',this.attr.productSelect)
			},
			
		
		    /**
			 * 立即购买
			 */
			goBuy: function(e) {
				if (this.isLogin === false) {
					toLogin()
				} else {
				
					this.goCat(true);
				}
			},
			
			
			/*
			 * 加入购物车
			 */
			goCat: function(news) {
				let that = this,
					productSelect = that.productValue[this.attrValue];
				
				if(this.dateList.length == 0){
					return that.$util.Tips({
						title: "该产品暂未排期，如需购买，请联系客服排期"
					});
				}
				console.log("this.attrValue",this.attrValue)
				if(!this.selectDay){
					return that.$util.Tips({
						title: "请选择游玩/出行日期"
					});
				}
			
				//如果有属性,没有选择,提示用户选择
				if (this.storeInfo.stock <= 0 || this.dateList.length == 0)
					return that.$util.Tips({
						title: "产品库存不足"
					});
			
				const found = this.dateList.find(function(element) {
				  return that.selectDay == element.date;  
				});
				
				if(found != undefined){
					if(found.stock <= 0){
						return that.$util.Tips({
							title: "所选日期暂无库存"
						});
					}
					if(found.adult_price <= 0){
						return that.$util.Tips({
							title: "所选日期价格未设置"
						});
					}
				} else {
					return that.$util.Tips({
						title: "所选日期暂未排期"
					});
				}
			
			
				let q = {
					is_new: news === undefined ? 0 : 1,
					mer_id: that.storeInfo.mer_id,
					product_id: that.id,
					cart_num: 2,
					adult_num:  2,
					child_num: 0,
					old_num: 0,
					room_num: 0,
					product_attr_unique: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : "",
					source: this.source,
					product_type: 0,
					spread_id: this.currSpid,
					price_date_id: found.id,
					price_date: this.selectDay,
					tour_type: this.storeInfo.tour_type,
				};
				
		
				 
				postCartTourAdd({data: q})
					.then(function(res) {
						console.log('res',res)
						let cartId = res.data.cart_id
						uni.navigateTo({
							url: '/pages/users/tourOrderConfirm/index?cartId=' + cartId+'&product_id='
							+that.id+'&sku_unique='+that.attr.productSelect.unique+'&selectDay='+that.selectDay
						});
					})
					.catch(res => {
						return that.$util.Tips({
							title: res
						});
					});
				},
				
			/**
			 * 打开属性插件
			 */
			selecAttr: function() {
				this.$set(this.attr, 'cartAttr', true);
				this.$set(this, 'isOpen', true);
			},
			shareProduct () {
				// #ifdef MP-ALIPAY
				 my.showSharePanel();
				 return;
				// #endif
				this.currentPage = false
				// #ifdef H5
				if (this.$wechat.isWeixin() === true) {
					this.weixinStatus = true;
				}
				// #endif
				this.posters = true;
				this.downloadFilePromotionCode();	
			},
			/**
			 * 分销
			 *
			 */
			listenerActionSheet: function() {
				if(this.promoter.isPromoter == 0){
					if(!this.isLogin){
						toLogin()
					}else{
						uni.navigateTo({
							url: `/pages/users/distributor/index`
						});
					}	
				}else {
					this.currentPage = false
					// #ifdef H5
					if (this.$wechat.isWeixin() === true) {
						this.weixinStatus = true;
					}
					// #endif
					this.posters = true;
					this.goPoster();
				}	
			},
			// 分享关闭
			listenerActionClose: function() {
				this.posters = false;
				this.currentPage = false;
			},
			//隐藏海报
			posterImageClose: function() {
				this.posterImageStatus = false
				this.posters = false;
			},
			//替换安全域名
			setDomain: function(url) {
				url = url ? url.toString() : '';
				//本地调试打开,生产请注销
				if (url.indexOf("https://") > -1) return url;
				else return url.replace('http://', 'https://');
			},
			/**
			 * 获取产品分销二维码
			 * @param function successFn 下载完成回调
			 *
			 */
			downloadFilePromotionCode: function(successFn) {
				let that = this;
				let type;
				// #ifndef MP
				type = 'wechat'
				// #endif
				// #ifdef MP
				type = 'routine'
				// #endif
				getProductCode(that.id, {
					type: type,
					product_type: 0
				}).then(async res => {
					that.codeImg = res.data.url
					that.goPoster()
				}).catch(err => {
					that.$util.Tips({
						title: err
					});
					that.posters = false;
					that.$set(that, 'PromotionCode', '');
					
				});
			},
			// 小程序关闭分享弹窗；
			goFriend: function() {
				this.posters = false;
				this.currentPage = false;
			},
			/**
			 * 生成海报
			 */
			async goPoster() {
				console.log("this.posterImage",this.posterImage)
				if (this.posterImage) {
					this.posterImageStatus = true
					this.posters = false
					return
				}
				let that = this;
				let arr2
				
				that.$set(that, 'canvasStatus', true);
				// uni.showLoading({
				// 	title: '海报生成中',
				// 	mask: true
				// });
				// #ifdef MP || APP-PLUS
				arr2 = [that.posterbackgd, await that.fileStoreImage(that.storeImage), await that.fileStoreImage(
					that.codeImg), await that.fileStoreImage(that.share_pic)];
				// #endif
				// #ifdef H5
				arr2 = [that.posterbackgd, await that.imgToBase(that.storeImage), await that.imgToBase(that.codeImg), await that.imgToBase(that.share_pic)];
				// #endif
				console.log('that.share_pic',that.share_pic)
				console.log("arr2",arr2)
				//生成推广海报
				that.$util.goodsPosterCanvas(arr2, that.storeInfo.store_name, that.storeInfo.price,  that.site_name, that.storeInfo.ot_price,  function(tempFilePath) {
					console.log('tempFilePath',tempFilePath)
					that.$set(that, 'posterImage', tempFilePath);
					that.$set(that, 'posterImageStatus', true);
					that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
					that.$set(that, 'canvasStatus', false);
					
				}, (err) => {
					console.log('err',err)
					that.$set(that, 'canvasStatus', false);
				});
			},
			//图片转符合安全域名路径
			fileStoreImage(url) {
				if(url){
					// #ifdef MP  || APP-PLUS
					let ishttps = url.split('//')[0] == 'https:'
					if (!ishttps) {
						url = 'https://'+url.split('//')[1]
					}
					// #endif
					return new Promise((resolve, reject) => {
						let that = this;
						uni.downloadFile({
							url: url,
							success: function(res) {
								resolve(res.tempFilePath);
							},
							fail: function(error) {
								console.log(error)
								return that.$util.Tips({
									title: '请检查图片地址是否在合法域名内'
								});
							}
						});
					})
				}	
			},
			// 图片预览；
			getpreviewImage: function() {
				if (this.posterImage) {
					let photoList = [];
					photoList.push(this.posterImage)
					uni.previewImage({
						urls: photoList,
						current: this.posterImage
					});
				} else {
					this.$util.Tips({
						title: '您的海报尚未生成'
					});
				}
			},
			/*
			 * 保存到手机相册
			 */
			// #ifdef MP
			savePosterPath: function() {
				let that = this;
				uni.getSetting({
					success(res) {
						if (!res.authSetting['scope.writePhotosAlbum']) {
							uni.authorize({
								scope: 'scope.writePhotosAlbum',
								success() {
									uni.saveImageToPhotosAlbum({
										filePath: that.posterImage,
										success: function(res) {
											that.posterImageClose();
											that.$util.Tips({
												title: '保存成功',
												icon: 'success'
											});
										},
										fail: function(res) {
											that.$util.Tips({
												title: '保存失败'
											});
										}
									})
								}
							})
						} else {
							uni.saveImageToPhotosAlbum({
								filePath: that.posterImage,
								success: function(res) {
									that.posterImageClose();
									that.$util.Tips({
										title: '保存成功',
										icon: 'success'
									});
								},
								fail: function(res) {
									that.$util.Tips({
										title: '保存失败'
									});
								},
							})
						}
					}
				})
			},
			// #endif
			// #ifdef APP-PLUS
			savePosterPath(){
				let that = this
				uni.saveImageToPhotosAlbum({
					filePath: that.posterImage,
					success: function(res) {
						that.posterImageClose();
						that.$util.Tips({
							title: '保存成功',
							icon: 'success'
						});
					},
					fail: function(res) {
						that.$util.Tips({
							title: '保存失败'
						});
					},
				})
			},
			// #endif
			//#ifdef H5
			ShareInfo() {
				let data = this.storeInfo;
				let href = location.href;
				if (this.$wechat.isWeixin()) {
					getUserInfo().then(res => {
						href =
							href.indexOf("?") === -1 ?
							href + "?spid=" + res.data.uid :
							href + "&spid=" + res.data.uid;
						let configAppMessage = {
							desc: data.store_info,
							title: data.store_name,
							link: href,
							imgUrl: data.image
						};
						this.$wechat.wechatEvevt([
							"updateAppMessageShareData",
							"updateTimelineShareData",
							"onMenuShareAppMessage",
							"onMenuShareTimeline"
						], configAppMessage).then(res => {
						}).catch(err => {
							console.log(err);
						})
					});
				}
			},
			//#endif
			async imgToBase(url) {
				let res = await imgToBase({
					image: url
				})
				return res.data.image
			},
			//复制口令
			copyPwd(){
				let that = this;
				copyPasswordApi({
					id: that.id,
					product_type: 0
				}).then(async res => {
					that.copyUrl = res.data.str;
					that.posters = false
					that.isCopy = true;
				})
			},
			closeCopy(){
				this.isCopy = false
			},
			// APP分享
			appShare(scene){
				let that = this
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
				let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由，也就是最后一个打开的页面路由
				uni.share({
					provider: "weixin",
					scene: scene,
					type: 0,
					href: `${HTTP_REQUEST_URL}${curRoute}&spid=${that.uid}`,
					title: that.storeInfo.store_name,
					summary: that.storeInfo.store_info,
					imageUrl: that.storeInfo.image,
					success: function(res) {
						uni.showToast({
							title: '分享成功',
							icon: 'success'
						})
						that.posters = false;
						uni.hideLoading();
					},
					fail: function(err) {
						uni.showToast({
							title: '分享失败',
							icon: 'none',
							duration: 2000
						})
						that.posters = false;
						uni.hideLoading();
					}
				});
			},
			
			filterRefund(refundRate){
				// switch (refundRate.type) {
				// 	case 1:
				// 		return "使用前"+ (refundRate.refund_time?  refundRate.refund_time +'分钟（含）之前':'')
				// 	case 2:
				// 		return "使用前"+ (refundRate.refund_time?  refundRate.refund_time +'分钟之后':'');

				// }
				switch (refundRate.type) {
					case 1:
						return  "使用前"+ this.convertMinutesToTimeAgo(refundRate.refund_time)+'（含）之前'
					case 2:
						return  "使用前"+  this.convertMinutesToTimeAgo(refundRate.refund_time)+'之后';
				
				}
			},
			convertMinutesToTimeAgo(minutes) {
			  const days = Math.floor(minutes / (24 * 60));
			  const remainingMinutes = minutes % (24 * 60);
			  const hours = Math.floor(remainingMinutes / 60);
			  const minutesPart = remainingMinutes % 60;
			
			  let result = '';
			  if (days > 0) {
			    result += `${days}天前`;
			    if (hours > 0 || minutesPart > 0) {
			      result += `${hours.toString().padStart(2, '0')}:${minutesPart.toString().padStart(2, '0')}`;
			      if (hours === 0 && minutesPart === 0) {
			        result = result.slice(0, -1);
			      }
			    } else {
			      result = result.slice(0, -1);
			    }
			  } else if (hours > 0) {
			    result += `${hours}小时${minutesPart > 0? `${minutesPart}分钟` : ''}`;
			  } else {
			    result += `${minutesPart}分钟`;
			  }
			
			  return result;
			},

			filterLimitType(type){
				// 1儿童限制2年龄限制3人群限制
				switch (type) {
					case 1:
						return "儿童限制";
					case 2:
						return "年龄限制";
					case 3:
						return "人群限制";
				}
				
			},
			
			filterType(type, day){
				// 类型 1.集合 2.结束行程 3.餐饮 4.酒店5.航班6.景点7.自费8.自由活动9.交通10.其他
				switch (type) {
					case 1:
						return "集合";
					case 2:
						return "结束行程";
					case 3:
						return day.dinner? day.dinner: "餐饮";
					case 4:
						return "酒店";
					case 5:
						return day.airplan ?day.airplan: "航班";
					case 6:
						return "景点";
					case 7:
						return "自费";
					case 8:
						return "自由活动";
					case 9:
						return "交通";
					case 10:
						return "其他";		
				}
				
			},
			filterTimeType(type, day){
				// 类型 1.集合 2.结束行程 3.餐饮 4.酒店5.航班6.景点7.自费8.自由活动9.交通10.其他
				switch (type) {
					case 1:
						return "预计时长"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 2:
						return "预计时长"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 3:
						return "用餐时长：约"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 4:
						return "预计时长"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 5:
						return "预计时长"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 6:
						return "游玩时长：约"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 7:
						return "预计时长"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 8:
						return "活动时长：约"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 9:
						return "交通时长：约"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
					case 10:
						return "预计时长"+ (day.take_time_hour?  day.take_time_hour +'小时':'') + (day.take_time_min ? day.take_time_min + '分钟':'');
				}
				
			},
			filterAddressType(type, day){
				// 类型 1.集合 2.结束行程 3.餐饮 4.酒店5.航班6.景点7.自费8.自由活动9.交通10.其他
				switch (type) {
					case 1:
						return "集合地点："+day.address;
					case 2:
						return "地点："+day.address;
					case 3:
						return "用餐地址："+day.address;
					case 4:
						return "地点："+day.address;
					case 5:
						return "地点："+day.address;
					case 6:
						return "地点："+day.address;
					case 7:
						return "地点："+day.address;
					case 8:
						return "地点："+day.address;
					case 9:
						return "地点："+day.address;
					case 10:
						return "地点："+day.address;
				}
				
			},
			
		}
	}
</script>
<style lang="scss" scoped>
	.ml8{
		top:2rpx
	}
	.product-con .nav {
		background-color: var(--view-theme);
		height: 152rpx;
		box-sizing: border-box;
		padding-bottom: 50rpx;
		margin-bottom: -50rpx;
	}
	.t-color {
		color: var(--view-theme);
	}
	.p-color {
		color: var(--view-priceColor);
	}
	.bt-color {
		background-color: var(--view-theme);
		border: 1px solid var(--view-theme);
	}
	.head-bar {
		background: #fff;
	}
	.generate-posters-new {
		width: 100%;
		background-color: #fff;
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 388;
		transform: translate3d(0, 100%, 0);
		transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
		border-top: 1rpx solid #eee;
		border-radius: 40rpx 40rpx 0 0;
	
		.generateCon {
			height: 220rpx;
		}
	
		.generateClose {
			width: 654rpx;
			height: 72rpx;
			background: #F5F5F5;
			border-radius: 36rpx;
			font-size: 26rpx;
			font-weight: 500;
			margin: 0 auto 40rpx;
		}
	
		.item {
			.pictrue {
				width: 86rpx;
				height: 86rpx;
				border-radius: 50%;
				margin: 0 auto 12rpx auto;
	
				image {
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
			}
		}
	}
	
	.generate-posters-new.on {
		transform: translate3d(0, 0, 0);
	}
	
	.generate-posters-new .item {
		flex: 1;
		text-align: center;
		font-size: 24rpx;
	}
	

	.product-con .footer {
		padding: 0 20rpx 0 40rpx;
	}
	.product-con .attribute .atterTxt {
		width: 400rpx;
	}
	.product-con .attribute .atterTxt1{
		color: #282828;
		&.hasAttr{
			&:after{
				content: "";
				display: inline-block;
				position: relative;
				top: -6rpx;
				margin: 0 6rpx;
				width: 5rpx;
				height: 5rpx;
				background-color: #282828;
				border-radius: 100%;
			}
			&:last-child{
				&:after{
					display: none;
				}
			}
		}
	}
	.product-con .coupon .activity {
		&::before,&::after{
			border: 1px solid var(--view-theme);
		}
		&::before{
			border-left-color: #ffffff;
		}
		&::after{
			border-right-color: #ffffff;
		}
	}
	.product-con .footer .item .iconfont {
		text-align: center;
		font-size: 40rpx;
	}
	.fenxiang_btn{
		.icon-ic_star1{
			color: var(--view-priceColor)!important;
		}
	}
	.product-con .wrapper .introduce {
		margin-top: 20rpx;
		padding-bottom: 20px;
		color: #000;
		font-weight: 900;
		&.atmosphere {
			padding: 30rpx 10rpx 10rpx;
			margin: 0;
			justify-content: space-between;
			align-items: flex-start;
			.title{
				width: 540rpx;
			}
		}
		.font-bg-red{
			position: relative;
			/* #ifdef H5 */
			top: -2rpx;
			/* #endif */
			/* #ifndef H5 */
			top: -4rpx;
			/* #endif */
		}
	}
	.product-con .integral{
		display: inline-block;
		margin: 20rpx 30rpx 0 0;
		color: #FF9000;
		background-color: #FFF4E6;
		height: 40rpx;
		line-height: 40rpx;
		border-radius: 22rpx;
		padding: 0 26rpx;
		font-size: 24rpx;
		font-weight: normal;
		&:last-child{
			margin-left: 0;
		}
	}
	.product-con .footer .item .iconfont.icon-ic_ShoppingCart {
		font-size: 40rpx;
		position: relative;
	}
	.product-con .footer .item .iconfont.icon-ic_ShoppingCart .num {
		color: #fff;
		position: absolute;
		font-size: 18rpx;
		height: 30rpx;
		border-radius: 200rpx;
		padding: 0 8rpx;
		box-sizing: border-box;
		top: -10rpx;
		right: -10rpx;
		background-color: var(--view-theme);
		min-width: 30rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.product-con .footer .bnt {
		// width: 444rpx;
		height: 76rpx;
		flex: 1 1 0%;
	}
	.product-con .footer .bnt .bnts {
		// width: 222rpx;
		flex: 1;
		text-align: center;
		line-height: 76rpx;
		color: #fff;
		font-size: 30rpx;
		font-weight: 700;
		&.sold_out {
			width: 444rpx;
			border-radius: 50rpx;
		}
		&.virtual_buy {
			width: 444rpx;
			border-radius: 50rpx;
		}
	}
	.product-con .footer .bnt .joinCart {
		border-radius: 50rpx 0 0 50rpx;
		background-image: linear-gradient(90deg, var(--view-bntColor11) 0%, var(--view-bntColor12) 100%);
		&.disabled{
			background: #bbb;
		}
	}
	.product-con .footer .bnt .buy {
		// border-radius: 0 50rpx 50rpx 0;
		// background-image: linear-gradient(90deg, var(--view-priceColor) 0%, var(--view-priceColor) 100%);
		background-image: linear-gradient(90deg, rgb(255, 165, 10), rgb(255, 119, 0));
	}
	.product-con .footer .bnt .buy[disabled] {
		background: #bbb;
	}
	.svipCon {
    height: 64rpx;
    padding: 0 20rpx;
		background: #FAE3BB;
    font-size: 24rpx;
    color: #B37400;
		border-radius: 10rpx;
		image{
			width: 38rpx;
			height: 38rpx;
			margin-right: 20rpx;
		}
  }
	.svipCon .svipBtn {
		font-size: 22rpx;
		.iconfont{
			font-size: 18rpx;
			margin-left: 4rpx;
		}
	}
	button {
		padding: 0;
		margin: 0;
		line-height: normal;
		background-color: #fff;
	}
	button::after {
		border: 0;
	}
	.contact {
		font-size: 16px;
		width: 50%;
		background-color: #fff;
		padding: 8rpx 0;
		border-radius: 0;
		margin: 0;
		line-height: 2;
	}
	.contact::after {
		border: none;
	}
	.canvas {
		z-index: 300;
		width: 750px;
		height: 1300px;
		position: relative;
		bottom: -10000rpx;
	}
	.poster-pop {
		width: 600rpx;
		height: 897rpx;
		position: fixed;
		left: 50%;
		transform: translateX(-50%);
		z-index: 399;
		top: 50%;
		margin-top: -500rpx;
	}
	.poster-pop image {
		width: 100%;
		height: 100%;
		display: block;
	}
	.poster-pop .close {
		width: 46rpx;
		height: 75rpx;
		position: fixed;
		right: 0;
		top: -73rpx;
		display: block;
	}
	.poster-pop .save-poster {
		background-color: #df2d0a;
		font-size: 22rpx;
		color: #fff;
		text-align: center;
		height: 76rpx;
		line-height: 76rpx;
		width: 100%;
		border-radius: 43rpx;
		margin-top: 20rpx;
	}
	.poster-pop .keep {
		color: #fff;
		text-align: center;
		font-size: 25rpx;
		margin-top: 10rpx;
	}
	.store-wrapper {
		.con-box {
			padding: 20rpx 20rpx 0;
			.title {
				font-size: 28rpx;
				color: #282828;
			}
			.moer-btn{
				font-size: 28rpx;
				color: #999999;
			}
			.img-box {
				.img-item {
					width: 212rpx;
					margin: 30rpx 15rpx 0 0;
					display: inline-block;
					&:nth-child(3n){
						margin-right: 0;
					}
					::v-deep image,::v-deep uni-image,::v-deep .easy-loadimage  {
						width: 212rpx;
						height: 212rpx;
						border-radius: 16rpx;
						display: inline-block;
					}		
					.txt {
						.title {
							margin-top: 20rpx;
						}
						.price {
							color: var(--view-priceColor);
							margin-top: 6rpx;
						}
					}
				}
			}
			::v-deep .uni-swiper-dot{
				width: 8rpx;
				height: 4rpx;
				background: rgba(0,0,0,.15);	
			}
			::v-deep .uni-swiper-dot-active{
				width: 16rpx;
				background: var(--view-theme);
			}
			.page_swiper,swiper {
				height: 760rpx;
			}
		}
	}
	.swiper-item,::v-deep uni-swiper-wrapper,::v-deep uni-swiper{
		height: 750rpx;
	}
	
	.product-con .product-intro .title {
	    font-size: 32rpx;
		font-weight: 700;
	    color: #282828;
	    height: 86rpx;
	    width: 100%;
	    text-align: left;
	    line-height: 86rpx;
	}
	.de-block{
		background-color: #f8fafd;
		border-radius: 5px;
		padding: 5px 0;
	}
	.ts-block-con {
		padding-left: 10px;
		padding-right:  10px;
		margin-bottom: 8px;
		text-align: left;
	}
	.ts-block-img-con {
	    height: 12px;
	    width: 26px;
	    position: relative;
	    top: 5px;
	    margin-right: 5px;
	}
	.route-detail-box{
		display: flex;
		flex-direction: column;
		background-color: #f8fafd;
		margin-bottom: 5px;
		padding: 10px 0 10px 10px;
		border-radius: 5px;
	}
	.route-detail-day{
		background-color: #f8fafd;
		text-align: start;
		margin-right: 5px;
		margin-bottom: 5px;
		line-height: 1.6;
	}
	.route-detail-hide{
		text-align: center;
		margin: 5px 0;
		color: var(--view-theme);;
	}
	.route-detail-content{
		position: relative;
		padding-bottom: 10px;
		margin-left: 30px;
	}
	.route-detail-day-content{
		position: relative;
		padding-bottom: 10px;
		padding-right: 10px;
	}
	.route-detail-day-title{
		position: relative;
		
	}
	.route-detail-img-block{
		position: absolute;
		left: -36px;
		top: 0;
		background: #f8fafd;
		padding: 0 6px;
		z-index: 3;
		align-items: center;
		justify-content: center;
	}
	.route-detail-img{
		width: 20px;
		height: 20px;
		position: relative;
		left: .10px;
	}
	.route-detail-img image {
		width: 100%;
		height: 100%;
	}
	.route-detail-boder-left{
		position: absolute;
		border-left: 1px dashed #999;
		left: -20px;
		top: 0;
		bottom: 0;
		transform: scaleX(.5);
	}
	.cost-table{
		border-radius: 10px;
		border: 1px solid #dde4ed
	}
	.cost-table-title{
		display: flex;
		flex-direction: row;
		align-items: center;
		background: #f6f8fa;
		border-radius: 10px 10px 0 0;
		padding: 10px;
	}
	.cost-table-td{
		display: flex;
		flex-direction: row;
		min-height: 30px;
		border-bottom: 1px solid #dde4ed;
	}
	.cost-table-td:last-child {
	    border-bottom: none;
	}
	.cost-table-td-left{
		width: 100px;
		border-right: 1px solid #dde4ed;
		padding: 10px;
		font-size: 14px;
		color: #333;
		align-items: center;
	}
	.cost-table-td-right{
		display: flex;
		justify-content: center;
		flex: 1;
		flex-direction: column;
		align-items: flex-start;
		padding: 10px;
	}
	.packge-tickets{
	    background: linear-gradient(rgb(255, 240, 225), rgb(255, 240, 225));
	    border-radius: 12 px;
	    margin-bottom: 8px;
	    padding: 0 0 10px;
	    position: relative;
	}
	.packge-tickets .head-bg {
	    height: 30px;
	    margin: 0 10px;
	    position: absolute;
	    width: 300px;
	    z-index: 1;
	}
	.packge-tickets .lab-title{
		color: #ff6a24;
		font-size: 16px;
		font-weight: bold;
		font-style: italic;
		letter-spacing: 2px;
		padding-top: 10px;
		padding-left: 15px;
	}
	.packge-tickets .riqi{
		border-style: solid; 
		border-width: 0.05rem;
		border-color: rgb(255, 177, 107); 
		background-color: white; 
		padding: 10px 0px 10px 10px;
		border-radius: 5px; 
		box-shadow: rgb(228, 222, 216) 0px 1px 4px; 
		margin: 10px 
	}
	.route-tab-box{
		display: flex;
		height: 30px;
		justify-content: space-between;
		align-items: center;
		margin: 0 30px 20px;
	}
	.header-tab-item{
		color: #333;
		font-size: 15px;
		font-weight: 400;
		height: 26px;
		line-height: 26px;
	}
	.tab-barline{
		height: 3px;
		border-radius: 25px;
		background-image: linear-gradient(-90deg, #0076f5, #00a7fa);
	}

	.header-box-new {
	    position: fixed;
	    background-color: #fff;
	    height: 36px;
	    justify-content: center;
	    z-index: 9;
	}
	.header-tab-box {
	    height: 30px;
	    margin: 0 25px;
	    justify-content: space-between;
	}
	.header-box-new, .header-tab-box {
	    width: 100%;
	    display: -webkit-flex;
	    display: -ms-flexbox;
	    display: flex;
	    align-items: center;
	}
	.navbar {
		position: fixed;
		background-color: #fff;
		top: 0;
		left: 0;
		z-index: 99;
		width: 100%;
	}
	.head-menu-new {
		display: flex;
		align-items: center;
		height: 54rpx;
		width: 140rpx;
		// background: rgba(0, 0, 0, .25);
		border: 0.5rpx solid #cecece;
		border-radius: 27rpx;
		.iconfont {
			flex: 1;
			text-align: center;
			// color: #fff;
			box-sizing: border-box;
			&.icon-ic_leftarrow {
				border-right: 1px solid #fff;
			}
		}
	}
	.navbar-title{
		display: flex;
		// align-items: center;
		color: #000;
		font-size: 16px;
		justify-content: center;
	}
	.poster-mask{
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0,0,0,0.8);
		z-index: 30;
		backdrop-filter: blur(5px);
	}
	.poster-loading{
		position: relative;
		width: 100%;
		z-index: 31;
	}
	.fixed-center{
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 40;
	}
	.day-centent{
		text-align: justify;
		text-justify: newspaper;
		word-break: break-all;
	}
</style>
